<?php
/**
 * Author: Administrator
 * Date: 2022/7/23 22:43
 */

namespace DesignPatterns\Behavioral\Iterator;

class Book
{
    protected string $title;
    protected string $author;
    public function __construct($title, $author)
    {
        $this->title = $title;
        $this->author = $author;
    }

    public function getTitle(): string
    {
        return $this->title;
    }

    public function getAuthor(): string
    {
        return $this->author;
    }

    public function getTitleAndAuthor(): string
    {
        return $this->title . ' by ' . $this->author;
    }

}